<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0043)http://bitsoup.de/planetsun/background.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="planetsun, Kepler, Newton, 2 body problem, two body problem, planet, sun, gravitation, OpenGL, java, applet, blaxxun, blaxxun3D">
<title>planetsun - the kepler problem</title>
<link rel="stylesheet" type="text/css" href="./Help_files/style.css">
<link rel="stylesheet" type="text/css" href="./Help_files/style(1).css">
</head>
<body onload="makeBitSoup()" style="background-color: #222222;">
<table id="contentlayout">
<tbody><tr>
<td id="content">
<p align="left">The astronom
          Johannes Kepler (1571 - 1630) was the first to discover that the planet's motions
          is described by ellipses. Later, he proposed the famous three Kepler's laws, 
          which describe (in good approximation) the basic constants of motions of our solar 
          system. These laws are:
          </p><ol>
            <li> The orbit of a planet about a sun is an ellipse with the Sun's center of mass at one focus</li>
            <li> A line joining a planet and a sun sweeps out equal areas in equal intervals of time</li>
            <li> The squares of the periods of the planets are proportional to the cubes of their semimajor axes</li>
          </ol>
        <p></p>
<hr>
<p>
        </p><h3>Some mathematics:</h3>
            The following provides a (very rough) introduction into the physics and 
            mathematics behind the Kepler problem and how it was applied to the planetsun 
            sample applications:
          <p></p>
<p>
              The Kepler problem means to solve the equation of motion for two masses with 
              mass <code>m1</code> and <code>m2</code> in Newton's gravitatioanl field.
          </p>
<p>
              The Lagrange function of the problem is given by
          </p>
<p class="code">
            <code>L = m1/2 * v1**2 + m2/2 * v2**2 - G*m1*m2/|r1 -r2|</code>
          </p>
<p>
              with 
          </p>
<p class="code">
              	<code>r1 = the position of mass 1</code>
<br>
              	<code>r2 = the position of mass 2</code>
<br>
              	<code>v1 = dr1/dt = velocity of mass 1</code>
<br>
              	<code>v2 = dr2/dt = velocity of mass 1</code>
<br>
              	<code>G = Newton's gravitional constant</code>
          </p>
<p>
              Inserting the Lagrange function in the Lagrange equation, we get a coupled system
              of six second order differential equations. By using the symmetries of the
              problem (1. translation symmetry 2. rotation symmetry 3. time symmetry) this
              problem can be reduced to two first order differential equation:
          </p>
<p class="code">
            <code>E = m * (dr/dt)**2 + L**2 / (2 * m * r**2) - a / r</code>
<br>
            <code>L = m * r**2 * dphi/dt</code>
          </p>
<p>
              where
          </p>
<p class="code">
            <code>(r, phi) = polar coordinates of the relative vector r1 - r2<br>
</code>
            <code>E = energy of the system<br>
</code>
            <code>L = angular momentum of the system<br>
</code>
            <code>m = the 'reduced mass': m1 * m2 / (m1 + m2).<br>
</code>
            <code>a = G * m1 * m2</code>
          </p>
<p>
              After some computation the solution is given by 
          </p>
<p class="code">
            <code>p / r = 1 + e * cos (phi)</code>
          </p>
<p>
              where the two constants <code>e</code> and <code>p</code> are defined through:
          </p>
<p class="code">
          	<code>p = L**2 / (m * a)</code>
<br>
          	<code>e = sqrt(1 + 2 * E * L**2 / (m * a**2))			[excentricity]</code>
          </p>
<p>
              Unfortunately, the equation cannot be solved in a closed form like <code>r = r(t)</code>. 
              But with some additional help parameter <code>w</code> defined through
          </p>
<p class="code">
            <code>r - a = -a * e * cos (w)</code>
          </p>
<p>
              We can write the solution for the radius <code>r</code>, the angle <code>phi</code> and the time <code>t</code> like:
          </p>
<p class="code">
            </p><ol>
            <li>
<code>t = sqrt(m * p**3 / a) * (e * cos(w) - w)</code>
<br>
</li>
            <li>
<code>r = p * (1 + w**2) / 2</code>
<br>
</li>
            <li>
<code>phi = acos((1/r - 1) / e)</code>
</li>
            </ol>
          <p></p>
<p>
              The position of the planet and the sun at any time is now calculated by first finding
              the corresponding parameter <code>w</code> in equation (1). This is done with the iterative 
              'Newton Method'.
              After finding <code>w</code>, we can use (2) to find the relative radius <code>r</code> 
              and finally equation (3) to find the angle <code>phi</code>.<br>
          </p>
<p>
              That's the basic mathematics of the planetsun program!
          </p>
</td>
</tr>
</tbody></table>
</body></html>